package com.gxgeek.javabasic.activemq.springjms.customer;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;

/**
 *
 * 消息监听器
 * Created by Administrator on 2017/7/13.
 */
@Service
@Slf4j
public class ConsumerService  implements MessageListener{
    @Override
    public void onMessage(Message message) {
        TextMessage textMessage = (TextMessage) message;
        try {
            log.info("接受消息----->{}",textMessage.getText());

        } catch (JMSException e) {
            e.printStackTrace();
        }
    }
}
